#!/usr/bin/env python
import socket, sys

host = sys.argv[1]
port = int(sys.argv[2])

#AF_INET is for IPv4
#SOCK_STREAM is for tcp
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))

s.sendall("GET / HTTP/1.0\n\n\r\n")
while 1:
  buf = s.recv(2048)
  if not len(buf):
    break
  sys.stdout.write(buf)
